<?php

/*
 * This file is part of PHP ENTITY LINK.
 *
 *  PHP ENTITY LINK is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  PHP ENTITY LINK is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with PHP ENTITY LINK.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Copyright (C) 2010 Peter Jacques, Michael Kyndt
 *
 */

namespace php_entity_link{

    /**
     * This files contains the mysql connection parameters.
     *
     * @author Peter Jacques, Michael Kyndt
     * @package php entity link
     * @version 1.0.0
     */
    class Hostfile {

        const HOST = 'host';
        const USER = 'user';
        const PWD  = 'pwd';
        const DB   = 'db';
        const NAMES = 'names';
        const COL_CONN = 'collation_connection';
        const PERSISTENT = 'persistent';

        /**
         * static array containing the connection data
         * @var <array>
         */
        private static $connections = array(
            'localhost' => array(
                  self :: HOST => 'localhost',
                  self :: USER => 'root',
                  self :: PWD => '',
                  self :: DB => 'php_entity_link',
                  self :: NAMES => 'UTF8',
                  self :: COL_CONN => 'UTF8_GENERAL_CI',
                  self :: PERSISTENT => false
                ),
             'conn2'=> array(
                  self :: HOST => 'test',
                  self :: USER => 'test',
                  self :: PWD => 'test',
                  self :: DB => 'test_db',
                  self :: NAMES => 'UTF8',
                  self :: COL_CONN => 'UTF8_GENERAL_CI',
                  self :: PERSISTENT => true
                )
        );

        /**
         * Use this function to get the connection for a specific connection
         * @param <string> $connection_name The connection name
         * @return <array> key value pairs with the connection data
         */
        public static function getConnection_params($connection_name){
            return self::$connections[$connection_name];
        }//getConnection_params

    }//ConnectionSettings

}//php_entity_link
?>